﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Activities;
using System.Diagnostics;
using MonolithHelper;

namespace bbdesktop7
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //test log
           // Logger.Write("testing log bbdesktop7", "button1_Click");

            Dictionary<string, object> myPara;

        myPara =  new Dictionary<string, object>
            {
                     { "ParentProcess", Process.GetCurrentProcess().ProcessName },
                     //{ "operand2", 10 },
                     //{ "operation", "add"}
            };


            WorkflowApplication wf = new WorkflowApplication(new MainActivity(),myPara);

            wf.Run();

        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            //process name
            // Get all instances of Notepad running on the local
            // computer.
            Process[] localByName = Process.GetProcessesByName("bbdesktop7");


            MessageBox.Show(Process.GetCurrentProcess().ProcessName +": " + localByName.Count().ToString());

        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            MainActivityCode.IsClosing = true;
        }
    }
}

